package ldh.im.fxbase.data.pojo.status;

import ldh.rpc.dto.ValueEnum;

public enum ImFeedbackStatus implements ValueEnum<Byte> {
    enable(1, "有效"),
    delete(2, "删除"),
    Processed(3, "已处理"),
    ;

    private Byte value;
    private String desc;

    private ImFeedbackStatus(Integer value, String desc){
        this.value = value.byteValue();
        this.desc = desc;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ImFeedbackStatus getByValue(Integer value) {
        if (value == null) return null;
        for (ImFeedbackStatus feedbackStatus : ImFeedbackStatus.values()) {
            if (feedbackStatus.getValue() == value.byteValue()) {
                return feedbackStatus;
            }
        }

        throw new RuntimeException("ImFeedbackStatus不支持这个值：" + value);
    }

    @Override
    public String toString() {
        return this.getDesc();
    }
}
